package main

import "fmt"

// 使用嵌套结构体里的方法，别的语言中的"继承"

type animal struct {
	action string
}

type dog struct {
	name string
	animal
}
/*
func newAnimal(action string) animal  {
	return animal{action: action}

}
*/

func (a animal) pa()  {
	fmt.Println("我会:", a.action)
}

func main() {
	s1 := dog{
		name:   "小狗",
		animal: animal{
			action: "爬",
		},
	}
	fmt.Println(s1.name)
	s1.pa()

}
